From 5b29d3d55e5901d3b86bf76aef96f0893e4a11fa Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 26 Nov 2004 05:51:32 +0000 Subject: [PATCH] Check column types on the new model, and check them all. (#159389, Olivier 2004-11-26 Matthias Clasen * gtk/gtkiconview.c (gtk_icon_view_set_model): Check column types on the new model, and check them all. (#159389, Olivier Andrieu) --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gtk/gtkiconview.c | 22 +++++++++++++++------- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index af9a19f041..c6c2600a14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-11-26 Matthias Clasen + * gtk/gtkiconview.c (gtk_icon_view_set_model): Check column types on the + new model, and check them all. (#159389, Olivier Andrieu) + * gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display): Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index af9a19f041..c6c2600a14 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-11-26 Matthias Clasen + * gtk/gtkiconview.c (gtk_icon_view_set_model): Check column types on the + new model, and check them all. (#159389, Olivier Andrieu) + * gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display): Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index af9a19f041..c6c2600a14 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-11-26 Matthias Clasen + * gtk/gtkiconview.c (gtk_icon_view_set_model): Check column types on the + new model, and check them all. (#159389, Olivier Andrieu) + * gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display): Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index af9a19f041..c6c2600a14 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-11-26 Matthias Clasen + * gtk/gtkiconview.c (gtk_icon_view_set_model): Check column types on the + new model, and check them all. (#159389, Olivier Andrieu) + * gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display): Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg) diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 0d9ec1cb96..9892eaaa6a 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -2955,24 +2955,32 @@ gtk_icon_view_set_model (GtkIconView *icon_view, if (model) { - GType pixbuf_column_type, text_column_type; + GType column_type; g_return_if_fail (gtk_tree_model_get_flags (model) & GTK_TREE_MODEL_LIST_ONLY); if (icon_view->priv->pixbuf_column != -1) { - pixbuf_column_type = gtk_tree_model_get_column_type (icon_view->priv->model, - icon_view->priv->pixbuf_column); + column_type = gtk_tree_model_get_column_type (model, + icon_view->priv->pixbuf_column); - g_return_if_fail (pixbuf_column_type == GDK_TYPE_PIXBUF); + g_return_if_fail (column_type == GDK_TYPE_PIXBUF); } if (icon_view->priv->text_column != -1) { - text_column_type = gtk_tree_model_get_column_type (icon_view->priv->model, - icon_view->priv->pixbuf_column); + column_type = gtk_tree_model_get_column_type (model, + icon_view->priv->text_column); + + g_return_if_fail (column_type == G_TYPE_STRING); + } - g_return_if_fail (text_column_type == G_TYPE_STRING); + if (icon_view->priv->markup_column != -1) + { + column_type = gtk_tree_model_get_column_type (model, + icon_view->priv->markup_column); + + g_return_if_fail (column_type == G_TYPE_STRING); } } -- 2.30.2